using System.Collections;
using System.Collections.Generic;
using UnityEngine;

[System.Serializable]
public class Stat//统计
{
    [SerializeField] private int baseValue;//可以作为基础hp、伤害等等

    public List<int> modifiers;

    public int GetValue()
    {
        int finalValue = baseValue;
        foreach (var modifier in modifiers)//比如modifiers是装备列表的话加伤害
        {
            finalValue += modifier;
        }
        return finalValue;
    }

    public void AddModifier(int _modifiers)
    {
        modifiers.Add(_modifiers);
    }

    public void RemoveModifier(int _modifiers)
    {
        modifiers.Remove(_modifiers);
    }

    public void SetDefaultValue(int _value)
    {
        baseValue = _value;
    }
}
